package com.yanqu.xiuxian.config.elementalbonds.enums;

import java.util.Arrays;

public enum ElementalBondsBlockBigType {

    NONE(0, "无"),
    NORMAL(1, "正常", true),
    NORMAL_BOMB(2, "正常炸弹", true),
    SPECIAL(3, "特殊", true),
    SPECIAL_BOMB(4, "特殊炸弹", true),
    FRAME(5, "框"),
    OTHER(6, "其它"),
    ;

    private final int type;
    private final String desc;
    private final boolean base;

    ElementalBondsBlockBigType(int type, String desc) {
        this.type = type;
        this.desc = desc;
        this.base = false;
    }

    ElementalBondsBlockBigType(int type, String desc, boolean base) {
        this.type = type;
        this.desc = desc;
        this.base = base;
    }

    public static ElementalBondsBlockBigType forType(int type) {
        return Arrays.stream(ElementalBondsBlockBigType.values())
                .filter(elementalBondsBlockBigType -> elementalBondsBlockBigType.getType() == type)
                .findFirst()
                .orElse(NONE);
    }

    public int getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public boolean isBase() {
        return base;
    }

}
